/**
 * 
 */
package com.whu.waterworks.service;

import com.whu.waterworks.dao.WaterPlantNormDao;
import com.whu.waterworks.model.WaterPlantNorm;

/**
 * @author： Joymin
 * @date：2016-4-1 上午9:35:27
 * 说明: 
 */
public class WaterPlantNormService {

	private boolean flag=false;	
	private WaterPlantNormDao waterPlantNormDao;
	
	public String saveWaterPlantNorm(WaterPlantNorm norm){
		String message=""; 
		WaterPlantNorm temp=waterPlantNormDao.getWaterPlantNormById(norm.getWaterPlantId());
		if(null!=temp){
			flag=waterPlantNormDao.updateWaterPlantNorm(norm);
		}
		else{
			flag=waterPlantNormDao.saveWaterPlantNorm(norm);
		}
		if(flag){
			message="提交成功！";
		}
		else{
			message="提交失败，请稍后！";
		}
		return message;		
	}
	
	
	
	public WaterPlantNorm getWaterPlantNormById(String id){
		return waterPlantNormDao.getWaterPlantNormById(id);
	}
	
	public WaterPlantNormDao getWaterPlantNormDao() {
		return waterPlantNormDao;
	}
	public void setWaterPlantNormDao(WaterPlantNormDao waterPlantNormDao) {
		this.waterPlantNormDao = waterPlantNormDao;
	}	


	
}
